package com.haixiaoke.saas.department.service.impl;

import java.util.List;

import com.haixiaoke.saas.common.core.domain.entity.SysMenu;
import com.haixiaoke.saas.department.domain.BizTenantMenu;
import com.haixiaoke.saas.department.mapper.BizTenantMenuMapper;
import com.haixiaoke.saas.department.service.IBizTenantMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 机构和菜单的关联Service业务层处理
 * 
 * @author panda
 * @date 2024-02-29
 */
@Service
public class BizTenantMenuServiceImpl implements IBizTenantMenuService {
    @Autowired
    private BizTenantMenuMapper bizTenantMenuMapper;

    /**
     * 查询机构和菜单的关联
     * 
     * @param depId 机构和菜单的关联主键
     * @return 机构和菜单的关联
     */
    @Override
    public BizTenantMenu selectBizDepMenuByDepId(Long depId) {
        return bizTenantMenuMapper.selectBizDepMenuByDepId(depId);
    }

    /**
     * 查询机构和菜单的关联列表
     * 
     * @param bizTenantMenu 机构和菜单的关联
     * @return 机构和菜单的关联
     */
    @Override
    public List<BizTenantMenu> selectBizDepMenuList(BizTenantMenu bizTenantMenu) {
        return bizTenantMenuMapper.selectBizDepMenuList(bizTenantMenu);
    }

    /**
     * 新增机构和菜单的关联
     * 
     * @param bizTenantMenu 机构和菜单的关联
     * @return 结果
     */
    @Override
    public int insertBizDepMenu(BizTenantMenu bizTenantMenu) {
        return bizTenantMenuMapper.insertBizDepMenu(bizTenantMenu);
    }

    /**
     * 修改机构和菜单的关联
     * 
     * @param bizTenantMenu 机构和菜单的关联
     * @return 结果
     */
    @Override
    public int updateBizDepMenu(BizTenantMenu bizTenantMenu) {
        return bizTenantMenuMapper.updateBizDepMenu(bizTenantMenu);
    }

    /**
     * 批量删除机构和菜单的关联
     * 
     * @param tenantIds 需要删除的机构和菜单的关联主键
     * @return 结果
     */
    @Override
    public int deleteBizDepMenuByDepIds(String[] tenantIds) {
        return bizTenantMenuMapper.deleteBizDepMenuByDepIds(tenantIds);
    }

    /**
     * 删除机构和菜单的关联信息
     * 
     * @param tenantId 机构和菜单的关联主键
     * @return 结果
     */
    @Override
    public int deleteBizDepMenuByDepId(String tenantId) {
        return bizTenantMenuMapper.deleteBizDepMenuByDepId(tenantId);
    }

    @Override
    public int insertBatchDepMenu(List<BizTenantMenu> depMenuList) {
        return bizTenantMenuMapper.insertBatchDepMenu(depMenuList);
    }

    @Override
    public List<Long> selectMenuIdsByDepId(String tenantId) {
        return bizTenantMenuMapper.selectMenuIdsByDepId(tenantId);
    }

    @Override
    public List<SysMenu> selectMenuByDepId(String tenantId) {
        return bizTenantMenuMapper.selectMenuByDepId(tenantId);
    }

    @Override
    public int deleteBizTenantMenuByMenuId(Long menuId) {
        return bizTenantMenuMapper.deleteBizTenantMenuByMenuId(menuId);
    }
}
